<!-- el-checkbox-group -->
<template>
  <el-checkbox-group v-model="checkList" @change="handleChange">
    <el-checkbox v-for="v in options" :label="v.value" :key="v.value" :disabled="v.disabled">{{v.label}}</el-checkbox>
  </el-checkbox-group>
</template>

<script>
export default {
  name: 'Checkbox',
  data () {
    return {
      checkList: []
    }
  },
  props: {
    value: {
      type: Array,
      default: () => []
    },
    options: {
      type: Array,
      default: () => []
    }
  },
  mounted () {
    this.checkList = this.value
  },
  methods: {
    handleChange (value) {
      this.$emit('input', value)
      this.$emit('change', value)
    }
  }
}

</script>
